package com.yufan.mq.kafka;


import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * spring boot demo
 * 消费者
 */
@Component
public class BootKafkaConsumer {

    @KafkaListener(topics = "java-demo-topic",groupId = "java-demo-group")
    public void listen(ConsumerRecord<String, String> record) {
        String value = record.value();
        System.out.println(value);
        System.out.println(record);
    }
}
